fix(cli): read real upstream_stats keys in mcpproxy status server counts#815
Merged
Conversation
'mcpproxy status' always printed 'Servers: 0 connected, 0 quarantined' because extractServerCounts read connected/quarantined/total while the daemon's GetStats builders emit connected_servers/total_servers (and no quarantined count at all). - extractServerCounts now reads connected_servers/quarantined_servers/ total_servers, falling back to the bare legacy keys for older daemons - both GetStats builders (stateview path in internal/server, manager fallback in internal/upstream) now emit quarantined_servers Found in v0.47.0-rc.4 release QA: live daemon had 14 connected + 2 quarantined; CLI showed 0/0. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Deploying mcpproxy-docs with
|
| Latest commit: |
9c35499
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://39d69347.mcpproxy-docs.pages.dev |
| Branch Preview URL: | https://fix-status-server-counts.mcpproxy-docs.pages.dev |
Member
Author
|
Cross-model review (Codex CLI 0.135.0): ACCEPT — "The changes consistently add support for the daemon's *_servers statistic keys and expose a quarantined server count without introducing an actionable regression in the modified code paths." Round 1/5, no findings to fix. |
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
📦 Build ArtifactsWorkflow Run: View Run Available Artifacts
How to DownloadOption 1: GitHub Web UI (easiest)
Option 2: GitHub CLI gh run download 28846919179 --repo smart-mcp-proxy/mcpproxy-go
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
mcpproxy statusalways printed "Servers: 0 connected, 0 quarantined" becauseextractServerCounts(cmd/mcpproxy/status_cmd.go) readconnected/quarantined/totalwhile the daemon's GetStats builders emitconnected_servers/total_servers— and no quarantined count existed at all.Found in v0.47.0-rc.4 release QA: live daemon had 14 connected + 2 quarantined; CLI showed 0/0.
Changes
extractServerCountsreadsconnected_servers/quarantined_servers/total_servers, with fallback to the bare legacy keys for older daemonsinternal/server, manager fallback ininternal/upstream) now emitquarantined_servers(stateviewServerStatus.Quarantined/ServerConfig.Quarantined)Tests
TestExtractServerCountsrewritten against the real payload shape (was red before the fix), legacy-keys case kept./scripts/test-api-e2e.sh: 65/65 PASS ·go test -race ./cmd/mcpproxygreen · golangci-lint v2: 0 issues🤖 Generated with Claude Code